﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Bootstrap.Definition.Enums;
using Bootstrap.Template.TemplateInnerItem;

namespace Bootstrap.Template.Tab
{



    public partial class BootstrapTabTemplate
    {
        #region Fields

        List<BootstrapTabTemplateInnerItem> List;
        BootstrapTabTemplateItem Menu;
        string TabType;

        #endregion

        #region Methods

        public BootstrapTabTemplate(List<BootstrapTabTemplateInnerItem> tabList, BootstrapTabTemplateItem menu)
        {
            List = tabList;
            Menu = menu;

            foreach (var item in List)
            {
                if (item.IsActive)
                    item.ItemClass += "active ";
                if (item.Disabled)
                    item.ItemClass += "disabled ";
            }

            switch (menu.TabTypeEnum)
            {
                case TabTypeEnum.Normal:
                    TabType = string.Empty;
                    break;
                case TabTypeEnum.Pill:
                    TabType = " nav-pills";
                    break;
                case TabTypeEnum.Stacked:
                    TabType = " nav-stacked";
                    break;
                case TabTypeEnum.PillAndStacked:
                    TabType = " nav-pills  nav-stacked";
                    break;
                default:
                    break;
            }
        }

        #endregion
    }
}
